<extend name="Index:base" />
<block name="title"><title>首页幻灯片</title></block>
<block name="style">
 <style>
.main,.panel-default>.panel-heading{
background:none;
}
body{
background:none;
}
.panel.panel-default,.panel .panel-body,.panel .panel-heading,.table-bordered {
	border:none;
}
.table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
	border:none;		
	padding:15px;	
	line-height:8px;
	height: 8px;
	border-top: 1px solid #d4d4d4;
	border-bottom: 1px solid #d4d4d4;
}
.name strong{
color:#000000;
font-size:15px;
font-weight:600;
}
.name {
	color:#20a8d8;
	font-size:12px;
}
.smallfont {
	color:#9c9c9c;
	font-size:12px;
}

.align-center{
	text-align:center; 
}
.title2{
text-align:center;
}
.table-bordered > tbody > tr .wd{
	text-align:left;	
}

.col-xs-2,.col-xs-4{
padding-right:0;
margin:10px 0;
}
.col-sm-3{
width:10%;
}
.col-sm-2{
width:8%;
}
.col-sm-1{
width:5%;
}
.col-sm-4{
width:18%;
}
.col-sm-1,.col-sm-2{
margin:16px 0;
}
.col-sm-3,.col-sm-4{
margin:10px 0;
}
.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4{
padding-right:0;
}
 </style>

</block>
	<!-- start: Header -->
<block name="body">

			<!-- end: Main Menu -->
						
		<!-- start: Content -->
		<div class="main ">
		
			<div class="row">
				<div class="col-lg-12">
					<h3 class="page-header"><i class="fa fa-life-bouy"></i>首页幻灯片</h3>
				</div>
			</div>

			<div class="row">				
				<div class="col-lg-12">
					<div class="panel panel-default">
						<div class="panel-heading">
							<a class="btn btn-default " href="{:U('Index/home')}" >焦点大图</i></a>
							&nbsp;&nbsp;&nbsp;
							<a class="btn btn-default " href="#" id="adv_add">新增焦点大图</i></a>
							<h2><span class="break"></span><strong>四张联动焦点组图</strong></h2>
							<a class="btn btn-default " href="#" id="adv_add_4">新增四张联动焦点图</i></a>
												
						</div>&nbsp;&nbsp;&nbsp;
						<ol class="breadcrumb" style="height:100px;background-color: #ffffff;">							
							<li><i class="fa fa-warning"></i><a href="#">操作提示：</a></li><br/>	
							<li><font style="font-size:8px;color:#888;">焦点大图区可设置背景颜色，四张联动区一组三个图片</font></br>
							<font style="font-size:8px;color:#888;">所有相关设置完成，使用底部的“更新板块内容”前台展示页面才会变化。</font>
							</li>							
						</ol>
						<div class="panel-body">

							
							<table class="table table-striped table-bordered bootstrap-datatable datatable">
							  <thead>
								  <tr>
									  
                                      <th>图片</th>
									  <th class="title2">操作</th>
								  </tr>
							  </thead>   
							  <tbody id="state">

								<foreach name="adlist_4" item="vo">
								<tr>
									
									<td style="width:90%">	
										<foreach name="vo.adv_pic" item="vpic">
										<div style="" class="col-md-3">
											<img class="img-thumbnail" src="{$vpic}" >
										</div>
										</foreach>										
									</td>
									<td class="align-center">
										<a class="label label-primary"  href="{:U('Index/home')}?id={$vo.adv_id}&pid=1" >编辑</i>
										</a>
										<br/>
										<br/>
										<br/>
										<a href="#" data-type="del" data-id="{$vo.adv_id}">
												
										<span class="label label-danger" >删除</span>
										</a>											
									 </td>

								</tr>
								</foreach>
							  </tbody>
						  </table> 
						<br><br><br>						  
						</div>
					</div>
				</div><!--/col
			
			</div><!--/row-->				
			
		<!-- end: Content -->
		<br><br><br>
		
	</div><!--/container-->
	
</block>
<block name="script">
<script>
$("#adv_add").click(function(){
	
	window.location.href ="{:U('Index/home')}?adv_add=adv_add&html=adv_add";	
});
$("#adv_add_4").click(function(){
	
		window.location.href ="{:U('Index/home')}?adv_add=adv_add_4&html=adv_add";	
});
$("#home_four").click(function(){
	
	window.location.href ="{:U('Index/home')}?adv_add=home_four&html=home_four";
});
$(".align-center a").click(function(){

    var id = $(this).attr('data-id');
	var type = $(this).attr('data-type');
	//alert(type);
	if (type=='del') {
		if(confirm("确定要删除吗？")){		
			//是	
			$.ajax({
				url:"{:U('Store/del')}",
				data:{id:id,table:5,str:'adv_id'},
				type:'post',
				dataType:'json',
				success:function (e) {			
				
					alert(e.info); 
					location.reload();				
				}
			});			
		}else{
			//否
			return false;
		}	
	}

});
</script>
</block>	









